Dynamic programming languages, such as JavaScript, Python, and Ruby, are often used to execute common behaviors at runtime that other languages may execute while compiling the code. Dynamic programming languages increase the flexibility of a software program, often slowing down execution due to additional runtime compilation. Inline caches are a technique frequently used to reduce code execution overhead for dynamic languages by generating “fast code” from common templates for the common behaviors. However, inline caches increase the memory usage of the program, by storing additional inline cached code and constant values. In particular for mobile devices, memory is a constrained resource.